package com.example.adapter;

import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.domain.GetInformation;
import com.example.mypro.R;

public class XYQ_LvAdapter extends BaseAdapter {
	private List<GetInformation> list;
	private Context context;

	public XYQ_LvAdapter(List<GetInformation> list, Context context) {
		this.list = list;
		this.context = context;
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int arg0) {
		return list.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		View view = LayoutInflater.from(context).inflate(R.layout.layout_getinformatiom,
				null);
		TextView tvnr = (TextView) view.findViewById(R.id.gi_tv_nr);
		tvnr.setText(list.get(arg0).getXyq_nr());
		TextView tvsj = (TextView) view.findViewById(R.id.gi_tv_sj);
		tvsj.setText(list.get(arg0).getXyq_sj());
		TextView tvtelephone = (TextView) view.findViewById(R.id.gi_tv_xh);
		tvtelephone.setText(list.get(arg0).getXyq_telephone());
		TextView tvxm = (TextView) view.findViewById(R.id.gi_tv_xm);
		tvxm.setText(list.get(arg0).getXyq_xs_xm());
		return view;
	}
}

